<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<title>应用详情</title>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/resources/layui/css/layui.css" media="all">
<script src="/resources/layui/layui.js" charset="utf-8"></script>
<style type="text/css">
.normal-state {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: green;
	display: block;
}
</style>
</head>
<body style="padding: 46px 00px 0px 00px; background-color: #e6e6e6c2;">
	<div class="layui-container">
		<div class="layui-row layui-col-space26">
			<div class="layui-col-md3 layui-card">
				<div class="layui-card-header">
					<div class="layui-row">
						<div class="layui-col-md4 normal-state" style="margin-top: 15px"></div>
						<div class="layui-col-md8" style="margin-left: 12px">应用详情</div>
					</div>
				</div>
				<div class="layui-card-body">
					<div class="layui-row">
						<div class="layui-col-md4">应用名称：</div>
						<div class="layui-col-md8">${xRpcConfig.applicationConfig.name}</div>
					</div>
					<div class="layui-row">
						<div class="layui-col-md4">主机地址：</div>
						<div class="layui-col-md8">${xRpcConfig.applicationConfig.hostAddress}</div>
					</div>
					<div class="layui-row">
						<div class="layui-col-md4">启动时间：</div>
						<div class="layui-col-md8">
							<fmt:formatDate value="${xRpcConfig.startUpTime}"
								pattern="yyyy-MM-dd HH:mm:ss" />
						</div>
					</div>
					<div class="layui-row">
						<div class="layui-col-md4">服务协议：</div>
						<div class="layui-col-md8">
							<c:choose>
								<c:when test="${xRpcConfig.protocolConfig==null}">
								-
							</c:when>
								<c:otherwise>
								${xRpcConfig.protocolConfig.name}:${xRpcConfig.protocolConfig.port}
							</c:otherwise>
							</c:choose>
						</div>
					</div>
					<div class="layui-row">
						<div class="layui-col-md4">注册中心：</div>
						<div class="layui-col-md8">
							${xRpcConfig.registryConfig.protocol}-${xRpcConfig.registryConfig.address}:${xRpcConfig.registryConfig.port}
						</div>
					</div>
				</div>
			</div>
			<div class="layui-col-md9" style="margin-top: -12px">
				<div class="layui-row">
					<div class="layui-col-md12 layui-card">
						<div class="layui-card-header">应用提供的服务</div>
						<div class="layui-card-body">
							<div class="layui-row">
								<c:forEach items="${xRpcConfig.serviceBeanList}"
									var="serviceBean">
									<div class="layui-col-md6">名称：${serviceBean.serviceInterface}</div>
									<div class="layui-col-md2">权重：${serviceBean.weight}</div>
									<div class="layui-col-md4">
										关联应用：
										<c:forEach
											items="${applicationServiceReferenceListMap[serviceBean.serviceInterface]}"
											var="applicationName">
											<a target="_blank" style="color: blue;"
												href="/xrpc-admin/application/${applicationName}">${applicationName}</a>
										</c:forEach>
									</div>
								</c:forEach>
							</div>
						</div>
					</div>
					<div class="layui-col-md12 layui-card">
						<div class="layui-card-header">应用引用的服务</div>
						<div class="layui-card-body">
							<div class="layui-row">
								<c:forEach items="${xRpcConfig.referenceBeanList}"
									var="referenceBean">
									<div class="layui-col-md6">名称：${referenceBean.referenceInterface}</div>
									<div class="layui-col-md2">超时时间：${referenceBean.timeout}</div>
									<div class="layui-col-md4">
										关联应用：
										<c:forEach
											items="${applicationReferenceServiceListMap[referenceBean.referenceInterface]}"
											var="providerServiceInfor">
											<a target="_blank" style="color: blue;"
												href="/xrpc-admin/application/${providerServiceInfor.applicationName}">${providerServiceInfor.applicationName}</a>
										</c:forEach>
									</div>
								</c:forEach>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
